package com.ymatou.test;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;

import android.os.RemoteException;

import com.android.uiautomator.core.UiCollection;
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;
import com.ymatou.run.RunTestCase;
import com.ymatou.util.Logger;
import com.ymatou.util.Random;

@SuppressWarnings("deprecation")
public class HelloUiAutomator extends UiAutomatorTestCase{

    private static final String TAG = HelloUiAutomator.class.getSimpleName();

    protected void setUp() throws Exception {
    	Logger.log(TAG, "setUp of " + getName());
        super.setUp();
    }
    
	public void testOpenYMTApp() throws IOException, UiObjectNotFoundException, RemoteException {
        Runtime.getRuntime().exec("monkey -p com.ymatou.shop -v 1");
        Logger.log(TAG, "testOpenYMTApp of " + getName());
        CheckGuideTest.checkGuide();
        PersonalInterestTest.personalInterest();
    }

    protected void tearDown() throws Exception {
        Logger.log(TAG, "tearDown of " + getName());
        super.tearDown();
    }
    
    public static void main(String[] args) {
    	RunTestCase runTestCase = new RunTestCase("testpersonalInterest", 
    			"com.ymatou.test.HelloUiAutomator", "", "2");
    	runTestCase.setDebug(false);
    	runTestCase.runUiautomator();
    }
}
